Skip to content

improvement(gong): validate integration against API docs, fix pagination/wandConfig consistency#5361

Merged
waleedlatif1 merged 4 commits into
stagingfrom
worktree-gong-validate-integration
Jul 2, 2026
Merged

improvement(gong): validate integration against API docs, fix pagination/wandConfig consistency#5361
waleedlatif1 merged 4 commits into
stagingfrom
worktree-gong-validate-integration

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Ran a full /validate-integration pass on the Gong integration (20 tools + block + registry entries) against Gong's live API docs
  • No critical or correctness bugs found — every endpoint, method, auth pattern, and response mapping checked out clean
  • Fixed minor consistency issues: marked cursor output optional: true on aggregate_activity/interaction_stats/list_flows (matching list_calls convention), added wandConfig to comma-separated ID fields (callIds, primaryUserIds, userIds, scorecardIds, reviewedUserIds)
  • Investigated adding Gong's Data Privacy erase endpoints and Engage Flow prospect-assignment endpoints (identified as high-value gaps) but could not verify their exact wire-level field names/schema against authoritative docs (Gong's interactive Swagger reference is behind an authenticated session) — deliberately left out rather than guess field names

Type of Change

  • Improvement

Testing

Tested manually — bun run lint and tsc --noEmit both clean

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@cursor

cursor Bot commented Jul 2, 2026

Copy link
Copy Markdown

PR Summary

High Risk
New irreversible data-privacy erase endpoints and Engage prospect assignment can delete or change production Gong/CRM data; purge inputs are user-only but workflows still need careful access control.

Overview
Expands the Gong block and tool registry with four new operations: Engage Assign Flow Prospects and Get Prospect Flows, plus data-privacy Purge Email Address and Purge Phone Number (wired through block dropdowns, inputs/outputs, and new tool modules). Lookup email/phone fields are reused for the purge operations; Engage ops add flowId, crmProspectsIds, and flowInstanceOwnerEmail with wand help on comma-separated IDs.

Several existing flows get small consistency fixes: wandConfig on comma-separated ID subblocks (callIds, primaryUserIds, userIds, scorecardIds, reviewedUserIds, CRM prospect IDs), cursor marked optional: true on paginated tool outputs (aggregate_activity, interaction_stats, list_flows), and get_extensive_calls now sends contentSelector.context: 'Extended' and contextTiming: ['Now', 'TimeOfCall'] in the request body.

Reviewed by Cursor Bugbot for commit e5eea58. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds four new Gong tools (purge_email_address, purge_phone_number, assign_flow_prospects, get_prospect_flows), registers them in the block and global tool registry, and applies two minor consistency fixes across the existing Gong toolset.

  • New tools: Data-privacy purge endpoints and Engage Flow prospect-assignment endpoints are wired end-to-end with correct auth, URL construction, and typed response mapping. Destructive purge parameters carry visibility: 'user-only' per the previous review cycle.
  • Consistency fixes: cursor output on aggregate_activity, interaction_stats, and list_flows is now marked optional: true (matching list_calls), and wandConfig is added to all comma-separated ID input fields in the block for a consistent UX.
  • get_extensive_calls: Hardcodes context: 'Extended' and contextTiming: ['Now', 'TimeOfCall'] in the contentSelector, which matches the tool's stated purpose of retrieving extended call data.

Confidence Score: 5/5

Safe to merge — all new tools follow established patterns, destructive purge parameters are correctly guarded with user-only visibility, and the consistency fixes are trivially correct.

The four new tools are well-structured and consistent with the existing Gong integration: auth headers, error handling via getGongErrorMessage, typed params/responses, and registry/block wiring are all correct. The purge endpoints carry visibility: 'user-only' on the target address/number, addressing the concern raised in the prior review cycle. The optional: true cursor fixes and wandConfig additions are mechanical and low-risk.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/blocks/blocks/gong.ts Adds four new operations to the dropdown, new block inputs for Engage Flow params, wandConfig on all comma-separated ID fields, and shares emailAddress/phoneNumber inputs between lookup and purge operations correctly.
apps/sim/tools/gong/assign_flow_prospects.ts New tool for assigning CRM prospects to a Gong Engage flow; correct POST body, response mapping, and typed outputs including prospectsNotAssigned.
apps/sim/tools/gong/get_prospect_flows.ts New tool for querying flows assigned to CRM prospects; POST body correctly sends crmProspectsIds array and maps response to shared GongAssignedFlow type.
apps/sim/tools/gong/purge_email_address.ts New tool for data-privacy email purge; correctly uses query-param POST pattern, user-only visibility on emailAddress, and proper error surfacing.
apps/sim/tools/gong/purge_phone_number.ts New tool for data-privacy phone purge; mirrors purge_email_address pattern with user-only visibility on phoneNumber.
apps/sim/tools/gong/types.ts Adds well-typed interfaces for all four new tools, sharing GongAssignedFlow and GongAssignedFlowFailure between assign and get tools; union type updated correctly.
apps/sim/tools/registry.ts All four new tools registered with correct keys, alphabetically ordered consistent with the surrounding entries.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant U as User/LLM
    participant B as Gong Block
    participant R as Tool Registry
    participant G as Gong API

    U->>B: Select operation (e.g. assign_flow_prospects)
    B->>R: Resolve tool → gong_assign_flow_prospects
    R->>G: POST /v2/flows/prospects/assign
    G-->>R: "{requestId, prospectsAssigned[], prospectsNotAssigned[]}"
    R-->>B: Typed output
    B-->>U: prospectsAssigned / prospectsNotAssigned

    U->>B: Select operation (get_prospect_flows)
    B->>R: Resolve tool → gong_get_prospect_flows
    R->>G: POST /v2/flows/prospects
    G-->>R: "{requestId, prospectsAssigned[]}"
    R-->>B: Typed output
    B-->>U: prospectsAssigned

    Note over U,B: Purge operations require user-only input
    U->>B: Select purge_email_address
    B->>R: Resolve tool → gong_purge_email_address
    R->>G: "POST /v2/data-privacy/erase-data-for-email-address?emailAddress=..."
    G-->>R: "{requestId}"
    R-->>B: requestId
    B-->>U: Async erase confirmed (irreversible)
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant U as User/LLM
    participant B as Gong Block
    participant R as Tool Registry
    participant G as Gong API

    U->>B: Select operation (e.g. assign_flow_prospects)
    B->>R: Resolve tool → gong_assign_flow_prospects
    R->>G: POST /v2/flows/prospects/assign
    G-->>R: "{requestId, prospectsAssigned[], prospectsNotAssigned[]}"
    R-->>B: Typed output
    B-->>U: prospectsAssigned / prospectsNotAssigned

    U->>B: Select operation (get_prospect_flows)
    B->>R: Resolve tool → gong_get_prospect_flows
    R->>G: POST /v2/flows/prospects
    G-->>R: "{requestId, prospectsAssigned[]}"
    R-->>B: Typed output
    B-->>U: prospectsAssigned

    Note over U,B: Purge operations require user-only input
    U->>B: Select purge_email_address
    B->>R: Resolve tool → gong_purge_email_address
    R->>G: "POST /v2/data-privacy/erase-data-for-email-address?emailAddress=..."
    G-->>R: "{requestId}"
    R-->>B: requestId
    B-->>U: Async erase confirmed (irreversible)
Loading

Reviews (7): Last reviewed commit: "fix(gong): require human-entered target ..." | Re-trigger Greptile

@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 2, 2026 5:41pm

Request Review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit b39f5d9. Configure here.

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit b39f5d9. Configure here.

…to ID list fields

- mark cursor output optional:true on aggregate_activity, interaction_stats, list_flows for consistency with list_calls
- add wandConfig to comma-separated ID fields (callIds, primaryUserIds, userIds, scorecardIds, reviewedUserIds) matching repo convention for CSV inputs
contentSelector.context/contextTiming were never set on the /v2/calls/extensive
request, so the documented context (CRM/external-system links) output was
silently always empty even though the field is declared in the tool's outputs.
@waleedlatif1 waleedlatif1 force-pushed the worktree-gong-validate-integration branch from b39f5d9 to 536b2c3 Compare July 2, 2026 16:58
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 536b2c3. Configure here.

- gong_purge_email_address / gong_purge_phone_number: POST /v2/data-privacy/erase-data-for-*,
  the write-half pairing with the existing lookup_email/lookup_phone read tools
- gong_assign_flow_prospects: POST /v2/flows/prospects/assign, enrolls CRM prospects into an
  Engage flow
- gong_get_prospect_flows: POST /v2/flows/prospects, looks up which flows a prospect is in

Field names verified against an OpenAPI-generator-produced client (cedricziel/gong-rs) whose
serde rename attributes mirror Gong's published spec, since Gong's interactive Swagger docs
require an authenticated session and can't be fetched directly.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 8cb1fc3. Configure here.

Comment thread apps/sim/tools/gong/purge_email_address.ts
Comment thread apps/sim/tools/gong/purge_phone_number.ts
emailAddress/phoneNumber on the purge tools were user-or-llm, letting an
agent autonomously pick the erasure target for an irreversible operation
with no human confirmation. Match the user-only visibility already used
for credentials.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit e5eea58. Configure here.

@waleedlatif1 waleedlatif1 merged commit a8f2709 into staging Jul 2, 2026
18 checks passed
@waleedlatif1 waleedlatif1 deleted the worktree-gong-validate-integration branch July 2, 2026 17:57
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit e5eea58. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant